package com.qfedu.provider.controller;

import com.qfedu.params.AddCollection;
import com.qfedu.provider.service.DbCollectionService;
import com.qfedu.utils.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author Administrator
 * @date 2024/11/23 上午11:58
 */
@RestController
@RequestMapping("/server/collection")
@Tag(name = "收藏管理")
public class CollectionController {
    @Resource
    private DbCollectionService dbCollectionService;

    @Operation(summary = "根据用户id查询收藏")
    @GetMapping("findByUserId")
    public R findAll(Integer uId,Integer productionTypeId) {
        return dbCollectionService.findAll(uId, productionTypeId);
    }

    @Operation(summary = "添加收藏")
    @PostMapping("add")
    public R add(@RequestBody AddCollection addCollection,@RequestParam(value = "uid") Integer uId) {
        return dbCollectionService.Add(addCollection,uId);
    }
}
